# Maintainer: Brandon Boese <brandonboese@protonmail.com>
pkgname=lomiri-weather-app
pkgver=5.13.5
pkgrel=1
pkgdesc="Provides current weather information for your mobile device"
url="https://gitlab.com/ubports/development/apps/lomiri-weather-app"
# armhf: blocked by lomiri-ui-toolkit
# riscv64: blocked by lomiri-indicator-network
arch="all !armhf !riscv64"
license="GPL-3.0-only"
source="https://gitlab.com/ubports/development/apps/lomiri-weather-app/-/archive/v$pkgver/lomiri-weather-app-v$pkgver.tar.gz
	0001-rename-WEATHER_APP_DIR-to-LOMIRI_WEATHER_APP_DIR.patch
	0002-point-qmlscene-to-qmlscene-qt5.patch
	"
depends="
	lomiri-indicator-network
	lomiri-ui-extras
	lomiri-ui-toolkit
	qqc2-suru-style
	qt5-qtlocation
	"
makedepends="
	click-dev
	cmake
	cmake-extras
	lomiri-trust-store-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	samurai
	"
checkdepends="
	py3-dbusmock
	py3-xdg
	xvfb-run
	"
subpackages="$pkgname-lang"
builddir="$srcdir/$pkgname-v$pkgver"
options="!check" # requires autopilot

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-DCLICK_MODE=OFF \
		-DINSTALL_TESTS=OFF
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	mv "$pkgdir"/usr/share/lomiri-weather-app/app/*.svg \
		"$pkgdir"/usr/share/lomiri-weather-app
}

sha512sums="
3a90bd80a8748e9f3a3ab76a36b5e9ba39f9a93999584d7e92e8412170f5c0b7ecb6466b7390420507a572b657a319df4dda6f683f2064e338ee7b21af769261  lomiri-weather-app-v5.13.5.tar.gz
1755d62aab06d873ba28ddcf5037e13c3faf16bb3b38881ac885caa5a4006f46705a1a25db382e30f8438d8e212e70e2767698ca41ed42d56c64ab86adfbb548  0001-rename-WEATHER_APP_DIR-to-LOMIRI_WEATHER_APP_DIR.patch
7251565108426e207cdc3ea68c677b4f9b3ba65390d7fac9510704e74985b8b258bd80bf4e25e1fd83fdb92c46228a7ad09a23f0de7b37bcc734fb30ea592628  0002-point-qmlscene-to-qmlscene-qt5.patch
"
